﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace HelenServer.Migrator;

[Table("zt_story")]
[Index("AssignedTo", Name = "assignedTo")]
[Index("Product", Name = "product")]
[Index("Status", Name = "status")]
public partial class ZtStory
{
    [Key]
    [Column("id", TypeName = "mediumint(8) unsigned")]
    public uint Id { get; set; }

    [Column("product", TypeName = "mediumint(8) unsigned")]
    public uint Product { get; set; }

    [Column("module", TypeName = "mediumint(8) unsigned")]
    public uint Module { get; set; }

    [Column("plan", TypeName = "text")]
    public string? Plan { get; set; }

    [Column("source")]
    [StringLength(20)]
    public string Source { get; set; } = null!;

    [Column("sourceNote")]
    [StringLength(255)]
    public string SourceNote { get; set; } = null!;

    [Column("fromBug", TypeName = "mediumint(8) unsigned")]
    public uint FromBug { get; set; }

    [Column("title")]
    [StringLength(255)]
    public string Title { get; set; } = null!;

    [Column("keywords")]
    [StringLength(255)]
    public string Keywords { get; set; } = null!;

    [Column("pri", TypeName = "tinyint(3) unsigned")]
    public byte Pri { get; set; }

    [Column("estimate", TypeName = "float unsigned")]
    public float Estimate { get; set; }

    [Column("status", TypeName = "enum('','changed','active','draft','closed')")]
    public string Status { get; set; } = null!;

    [Column("stage", TypeName = "enum('','wait','planned','projected','developing','developed','testing','tested','verified','released','closed')")]
    public string Stage { get; set; } = null!;

    [Column("stagedBy")]
    [StringLength(30)]
    public string StagedBy { get; set; } = null!;

    [Column("mailto", TypeName = "text")]
    public string? Mailto { get; set; }

    [Column("openedBy")]
    [StringLength(30)]
    public string OpenedBy { get; set; } = null!;

    [Column("openedDate", TypeName = "datetime")]
    public DateTime OpenedDate { get; set; }

    [Column("assignedTo")]
    [StringLength(30)]
    public string AssignedTo { get; set; } = null!;

    [Column("assignedDate", TypeName = "datetime")]
    public DateTime AssignedDate { get; set; }

    [Column("lastEditedBy")]
    [StringLength(30)]
    public string LastEditedBy { get; set; } = null!;

    [Column("lastEditedDate", TypeName = "datetime")]
    public DateTime LastEditedDate { get; set; }

    [Column("reviewedBy")]
    [StringLength(255)]
    public string ReviewedBy { get; set; } = null!;

    [Column("reviewedDate")]
    public DateOnly ReviewedDate { get; set; }

    [Column("closedBy")]
    [StringLength(30)]
    public string ClosedBy { get; set; } = null!;

    [Column("closedDate", TypeName = "datetime")]
    public DateTime ClosedDate { get; set; }

    [Column("closedReason")]
    [StringLength(30)]
    public string ClosedReason { get; set; } = null!;

    [Column("toBug", TypeName = "mediumint(8) unsigned")]
    public uint ToBug { get; set; }

    [Column("childStories")]
    [StringLength(255)]
    public string ChildStories { get; set; } = null!;

    [Column("linkStories")]
    [StringLength(255)]
    public string LinkStories { get; set; } = null!;

    [Column("duplicateStory", TypeName = "mediumint(8) unsigned")]
    public uint DuplicateStory { get; set; }

    [Column("version", TypeName = "smallint(6)")]
    public short Version { get; set; }

    [Column("deleted", TypeName = "enum('0','1')")]
    public string Deleted { get; set; } = null!;
}